home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-02-05 | 2.3 KB | 53 lines | [TEXT/MACA] |
- cat think-c-pap-routines-doc.txt
- From: sw@kernel-technology.co.uk (Sak Wathanasin)
- Subject: ThinkC Source for PAP i/f routines
- Date: 29 Jan 89 15:13:33 GMT
- Organization: Kernel Technology Ltd
-
- I've just received my Jan 89 copy of MacTutor, and I noticed the request
- for PAP i/f routines. I attach below two files: pap.c and pap.h that are
- meant to be built into a project, and called from your host application.
- Because I do not build them into a DRVR (although you can), they are much
- simpler. Morever, they are self-contained and can be built using the
- ThinkC compiler alone (I've used both ThinkC 2.x and 3.0).
-
- The pap.c file includes a set of test routines (conditonally compiled
- using the variable TEST). When enabled, they simulate the action of the
- LW, but write the PS to a file. This allows you to test the sequence of
- PAP calls without having an LW present. To use the test routines, just
- call the PAP routines as usual, and periodically call the routine
- TestDelay (your main event loop is a good place).
-
- To use them,
- a) call the routine PAPLoad once to load the PAP routines from the
- LW driver
- b) call PAPOpen to open a connection to the LW
- c) call PAPRead/PAPWrite as required to talk to the printer
- d) call PAPClose to close the connection to the printer
- e) repeat (b) to (d) as required; see MacTutor article on details of
- how to send EOF to the printer
- f) the PAPStatus call can be used to return info about the printer at
- any time
- f) call PAPUnload once before your application exits (you must do this
- because the PAP mgr has VBL tasks running and these must be removed)
-
- I hope that you will find these routines useful. I have used them with
- all vintages of LW drivers from 2.0 to 5.2, and all Systems from 2.1 to
- 6.0.2 (note that if you use a machine with the 64K roms, you may have to
- install the AppleTalk drivers in your system file).
- I would be glad to hear of any bug reports.
-
- If anyone can add any details of the PAP mgr to that contained in Bob
- Denny's excellent MacTutor article, please post to the net. In particular,
- I'd like to know if there is any way of aborting a PS job once it has
- started.
-
- Sak Wathanasin
-
- uucp:...!ukc!kernel!sw
- JANET: sw@uk.co.kernel
- BITNET: sw%kernel.co.uk%ukc.ac.uk@ukacrl.bitnet
- other:sw@kernel.co.uk
- phone:(+44) 532 444566
- snail:Kernel Technology Ltd, 46 The Calls, Leeds LS2 7EY
- command: